package Odinote;

use strict;
use warnings;

=head1 NAME

Odinote - A note-taking interface

=head1 VERSION

Version 0.1a

=cut

our $VERSION = '0.1a';

=head1 SYNOPSIS

This module interfaces with Gtk and glade to control the Odinote application

=head1 EXPORT

=cut

use lib '../Odinote';

use Glib qw/TRUE FALSE/;
use Gtk2 '-init';
use Gtk2::GladeXML;

use LaTeX::Driver;
use LaTeX::TOM;

use Odinote::Callbacks;
use Odinote::Main;
use Odinote::About;
use Odinote::OpenFile;
use Odinote::Document;
use Odinote::DocTabs;
use Odinote::Preferences;

my $gui;

=head1 FUNCTIONS

=head2 run

=cut

sub run { shift->_init(shift); Gtk2->main; }

#add ability to parse cl arguments for things like which conf file to use

=head2 _init

=cut

sub _init
{
  shift;
  my $glade_file = shift;

  $gui = Gtk2::GladeXML->new($glade_file);
  $gui->signal_autoconnect_from_package("Odinote::Callbacks");

  Odinote::Preferences->_init; #add support for a file
  Odinote::Main->_init($gui->get_widget('odinote_main'));
  Odinote::Main->maximize;
  Odinote::About->_init($gui->get_widget('about_dialog'));
  Odinote::OpenFile->_init($gui->get_widget('open_file_dialog'));
  Odinote::DocTabs->_init($gui->get_widget('document_tabs'));
}

=head1 AUTHOR

Gregory McWhirter, Steven Danna, C<< <odinote-discuss at googlegroups.com> >>

=head1 BUGS

Please report any bugs or feature requests to C<odinote-discuss at googlegroups.com>, or through
the web interface at L<http://odinote.googlecode.com>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.


=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Odinote


You can also look for information at:

=over 1

=item * The Odinote Wiki

L<http://code.google.com/p/odinote/w/list>

=back


=head1 ACKNOWLEDGEMENTS


=head1 COPYRIGHT & LICENSE

Copyright 2008 Gregory McWhirter, Steven Danna, all rights reserved.

This program is distributed under the MIT License. See the COPYING file that came with the distribution.


=cut

1;
